package com.hdy.login.service.impl;

import com.hdy.framework.common.service.impl.CommonServiceImpl;
import com.hdy.login.dao.LoginDao;
import com.hdy.login.dto.UserDto;
import com.hdy.login.entity.User;
import com.hdy.login.service.LoginService;

/*
	by 何栋宇
	2013-1-19
 */
public class LoginServiceImpl extends CommonServiceImpl implements LoginService{

	private LoginDao loginDao;

	public LoginDao getLoginDao() {
		return loginDao;
	}
	public void setLoginDao(LoginDao loginDao) {
		this.loginDao = loginDao;
	}
	@Override
	public UserDto saveUser(UserDto dto) {
		User user = dto.toEntity();
		this.loginDao.saveUser(user);
		//打开就会报异常 事务就会回滚
//		int i = 1/0;
//		throw new RuntimeException();
		return user.toDto();
	}
}
